package com.itheima.gaunbing;

import java.util.concurrent.ArrayBlockingQueue;

public class Hanze implements Runnable {
    ArrayBlockingQueue<String> queue ;

    public Hanze(ArrayBlockingQueue<String> queue) {
        this.queue=queue;
    }

    @Override
    public void run() {
        while (true) {
            //直接从 保温箱中 取灌饼 即可
            String take = null;
            try {
                take = queue.take();
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("从保温箱中取出了一个" + take);

        }

    }
}
